package com.yiqi.lottery.feature.mine.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.yiqi.lottery.entity.bo.OrderDetailBo;
import com.yiqi.lottery.entity.bo.RegisterBo;
import com.yiqi.lottery.feature.mine.contract.BindContract;
import com.yiqi.lottery.feature.mine.contract.DetailContract;
import com.yiqi.lottery.feature.mine.dependencies.bind.DaggerBindModelComponent;
import com.yiqi.lottery.feature.mine.dependencies.detail.DaggerDetailModelComponent;
import com.yiqi.lottery.framework.api.ApiLib;
import com.yiqi.lottery.framework.api.UserApi;
import io.reactivex.Observable;

import javax.inject.Inject;

public class DetailModel implements DetailContract.Model {

    @Inject
    UserApi api;


    @Inject
    public DetailModel() {

        DaggerDetailModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<OrderDetailBo> getOrderDetail(int order_id,int type) {
        return api.getOrderDetail(order_id,type).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

    @Override
    public Observable<OrderDetailBo> getCopurceDetail(int order_id) {
        return api.getCopurceDetail(order_id).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
